import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { TaintsService } from './taints.service';
import { ResponseUtil } from '../common/utils/response.util';
import { NodeService  } from '../node/node.service';
import { Inject } from '@nestjs/common';
@Controller('taints')
export class TaintsController {
  constructor(private readonly taintsService: TaintsService) {}
  @Inject(NodeService)
  private readonly NodeService:NodeService;

   //创建节点污点 
    @Post('/update/:agentId')
    createOrUpdate(@Body() body: any) {
      this.NodeService.postUpdateNodeTaints(body);
      return ResponseUtil.success(body, '创建及更新污点成功');
    }



    // 获取污点列表
    @Post('/list/:agentId')
    list() {
      return this.taintsService.postListNodeTaints();
    }
}
